// +----------------------------------------------------------------------
// | 加梯 [ LIFT赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.lift.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed LIFT并不是自由软件，未经许可不能去掉LIFT相关版权
// +----------------------------------------------------------------------
// | Author: 加梯 Team <admin@lift.com>
// +----------------------------------------------------------------------

import request from '@/libs/request';
import qs from "query-string";

/**
 * @description 角色管理--列表
 * @param {Object} param data {Object} 传值参数
 */
export function systemRoleListApi(data) {
  return request({
    // url: 'user/user',
    url: "asysRole/selectAlljuese?" + qs.stringify(data),
    method: "get"
    // params: data,
  });
}

/**
 * @description 查询角色分配的权限
 * @param {Object} param data {Object} 传值参数
 */
export function selectSystUserhquanxianDetailApi(data) {
  return request({
    // url: 'user/user',
    url: "asysRole/hquanxian?" + qs.stringify(data),
    method: "post"
    // params: data,
  });
}

/**
 * @description 查询角色分配的权限
 * @param {Object} param data {Object} 传值参数
 */
export function selectSystUserApi(data) {
  return request({
    // url: 'user/user',
    url: "asysRole/selectSystUser?" + qs.stringify(data),
    method: "post"
    // params: data,
  });
}

/**
 * @description 列表
 * @param {Object} param data {Object} 传值参数
 */
export function adminListApi(data) {
  return request({
    url: '/setting/admin',
    method: 'get',
    params: data,
  });
}

/**
 * @description 管理员添加表单
 */
export function adminFromApi() {
  return request({
    url: '/setting/admin/create',
    method: 'get',
  });
}

/**
 * @description 管理员编辑表单
 * @param {Number} param id {Number} 管理员id
 */
export function adminEditFromApi(id) {
  return request({
    url: `/setting/admin/${id}/edit`,
    method: 'get',
  });
}

/**
 * @description 管理员删除
 * @param {Number} param id {Number} 管理员id
 */
export function adminDelFromApi(id) {
  return request({
    url: `/setting/admin/${id}`,
    method: 'DELETE',
  });
}

/**
 * @description 管理员 修改状态
 * @param {Object} param data {Object} 传值
 */
export function setShowApi(data) {
  return request({
    url: `setting/set_status/${data.id}/${data.status}`,
    method: 'PUT',
  });
}
